FROM mysql:5.7.40

# 添加Nacos数据库初始化脚本
ADD https://raw.githubusercontent.com/alibaba/nacos/develop/distribution/conf/mysql-schema.sql /docker-entrypoint-initdb.d/01-nacos-mysql.sql

# 复制我们的数据库初始化脚本
COPY database_init.sql /docker-entrypoint-initdb.d/02-library-init.sql

# 设置文件权限
RUN chown -R mysql:mysql /docker-entrypoint-initdb.d/

EXPOSE 3306
CMD ["mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci"]